<template>
  <div>
    <h2>Shop</h2>

    title :{{ shopStore.title }} <br>
    count :{{ shopStore.count }} <br>
    g3 :{{ shopStore.g3 }} <br>
    g4 :{{ shopStore.g4(333) }} <br>
    g5 :{{ shopStore.g5 }} <br>
    add :{{ shopStore.add(1000) }} <br>

    <button @click="setValue">setValue</button>
  </div>
</template>
<script setup>
import { useShopStore } from "./store";
const shopStore = useShopStore();
const setValue = () => {
  shopStore.$state = {
    title: 'haha shop'
  };
  // shopStore.$patch((state) => {
  //   state.title = 'hi Shop';
  //   state.count = 400;
  // });
  // shopStore.$patch({
  //   title: 'hello shop',
  //   count: 300
  // });
};
</script>